home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Talking Clock Pro™ 2.0.1 / Talking Clock Pro Source / Extension / Source / x.c < prev   
Encoding:
C/C++ Source or Header  |  1993-09-03  |  1.4 KB  |  72 lines  |  [TEXT/CWIE]

  1. /*
  2.  * x.c ©1993 Jon Wätte (h+@nada.kth.se) All Rights Reserved
  3.  *
  4.  * Please read the paragraph marked $$$ in x.h before you use this source
  5.  * file.
  6.  *
  7.  * This file may be used and distributed for free, if certain conditions
  8.  * are met. These conditions are outlined in the accompanying file x.h.
  9.  * This file may NOT be distributed if it is in any way modified from the
  10.  * original as distributed by Jon Wätte. Also it may only be distributed
  11.  * accompanying the file x.h. See x.h for details.
  12.  *
  13.  * v1.0 930826 - Initial release
  14.  */
  15.  
  16. #include <Types.h>
  17. #include "x.h"
  18.  
  19.  
  20. JBT * __cur_buf = NULL ;
  21. #ifdef FAILINFO
  22. char * __err_file = NULL ;
  23. int __err_line = 0 ;
  24. #endif
  25.  
  26.  
  27. #ifdef FAILINFO
  28. void
  29. __FailNil ( void * p , char * file , int line ) {
  30.     if ( ! p ) {
  31.         __err_file = file ;
  32.         __err_line = line ;
  33.         if ( __cur_buf ) {
  34.             longjmp ( CB2JB __cur_buf , -108 ) ;
  35.         }
  36.         DebugStr ( "\pException uncaught!" ) ;
  37.     }
  38. }
  39.  
  40.  
  41. void
  42. __FailErr ( short err , char * file , int line ) {
  43.     if ( err ) {
  44.         __err_file = file ;
  45.         __err_line = line ;
  46.         if ( __cur_buf ) {
  47.             longjmp ( CB2JB __cur_buf , err ) ;
  48.         }
  49.         DebugStr ( "\pException uncaught!" ) ;
  50.     }
  51. }
  52. #else
  53. void
  54. FailNil ( void * p ) {
  55.     if ( ! p ) {
  56.         longjmp ( * __cur_buf , -108 ) ;
  57.     }
  58.     DebugStr ( "\pException uncaught!" ) ;
  59. }
  60.  
  61.  
  62. void
  63. FailErr ( short err ) {
  64.     if ( err ) {
  65.         if ( __cur_buf ) {
  66.             longjmp ( * __cur_buf , err ) ;
  67.         }
  68.         DebugStr ( "\pException uncaught!" ) ;
  69.     }
  70. }
  71. #endif
  72.